#include<bits/stdc++.h>
using namespace std;
const int NN=1e6+4,P=1e9+7;
int f[NN],fac[NN],ifac[NN],s[NN];
int qmi(int a,int b)
{
    int res=1;
    while(b)
    {
        if(b&1)
            res=1ll*res*a%P;
        a=1ll*a*a%P;
        b>>=1;
    }
    return res;
}
int A(int a,int b)
{
    if(a<b||b<0)
        return 0;
    return 1ll*fac[a]*ifac[a-b]%P;
}
int main()
{
    freopen("game.in","r",stdin);
    freopen("game.out","w",stdout);
    int n,k;
    scanf("%d%d",&n,&k);
    fac[0]=1;
    for(int i=1;i<=n;i++)
        fac[i]=1ll*fac[i-1]*i%P;
    ifac[n]=qmi(fac[n],P-2)%P;
    for(int i=n-1;~i;i--)
        ifac[i]=1ll*ifac[i+1]*(i+1)%P;
    int ans=0;
    for(int i=1;i<=n;i++)
    {
        int x;
        scanf("%d",&x);
        if(i==1)
            ans=(ans+1ll*x*A(n-1,k)%P);
        else if(i==2)
            ans=(ans+1ll*x*(A(n-2,k)-1ll*A(n-2,k-1)*k%P+P)%P)%P;
        else
            ans=(ans+1ll*x*(A(n-2,k)-1ll*A(n-3,k-1)*k%P+P)%P)%P;
    }
    printf("%lld",1ll*ans*qmi(A(n-1,k),P-2)%P);
    return 0;
}